<template>
  <div class="today_commend">
    <div class="commend_box" @click="$router.push('/gameinfo/gameid/5546')">
      <div class="icon_commend">
        <img src="../../../assets/img/home/ic_commend.png" alt="" />
        <span>今日推荐</span>
      </div>
      <div class="icon_line"></div>
      <div class="icon_text_hot">热</div>
      <div class="icon_download">下载</div>
      <div class="content_box">
        <div class="game_info">
          <div class="game_name">妖神传说(GM管理特权)</div>
          <div class="genre_str_box">
            <span>角色 • 仙侠</span>
          </div>
          <div class="game_type_box">
            <span
              v-for="(label, i) in game_labels"
              :key="i"
              class="labels"
              :style="{ background: label.bgcolor + '2d' }"
            >
              <span :style="{ color: label.bgcolor }">
                {{ label.label_name }}
              </span>
            </span>
          </div>
        </div>
        <img src="https://p1.277sy.com/2021/04/23/608274bea4945.gif" alt="" />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      game_labels: [
        {
          bgcolor: "#59bcf6",
          label_name: "官方变态服",
        },
        {
          bgcolor: "#ffaa1c",
          label_name: "充值1:10000",
        },
        {
          bgcolor: "#ff7c7c",
          label_name: "送满级VIP",
        },
        {
          bgcolor: "#ff7c7c",
          label_name: "元宝200W",
        },
        {
          bgcolor: "#ff8839",
          label_name: "绑定元宝300W",
        },
      ],
    };
  },
};
</script>

<style lang="less" scoped>
.today_commend {
  width: 9.466667rem;
  height: 4.8rem;
  padding: 0 0.266667rem;
  margin-top: 0.266667rem;
  .commend_box {
    box-sizing: border-box;
    position: relative;
    width: 9.466667rem;
    height: 4.4rem;
    padding: 0 0.266667rem;
    background: #fff;
    border-radius: 0.266667rem;
    .icon_line {
      position: absolute;
      top: 0.386667rem;
      left: -0.133333rem;
      z-index: 1;
      width: 0.133333rem;
      height: 0.853333rem;
      background: #c83102;
      border-radius: 0 0 0 0.266667rem;
    }
    .icon_commend {
      position: absolute;
      top: 0.266667rem;
      left: -0.133333rem;
      z-index: 2;
      width: 3.146667rem;
      height: 0.88rem;
      background: linear-gradient(47deg, #ff8e43, #ff5543);
      opacity: 1;
      border-radius: 0.16rem 0.493333rem 0.493333rem 0;
      display: flex;
      align-items: center;
      img {
        margin: 0 0.133333rem 0 0.266667rem;
        display: inline-block;
        width: 0.533333rem;
        height: 0.533333rem;
      }
      span {
        font-size: 0.48rem;
        font-weight: 800;
        color: #fff;
      }
    }
    .icon_text_hot {
      position: absolute;
      top: 0;
      right: 0.266667rem;
      width: 0.92rem;
      height: 0.786667rem;
      border-radius: 0 0 0.493333rem 0.493333rem;
      background: #fff2d8;
      font-size: 0.426667rem;
      font-weight: bold;
      color: #ff6f0f;
      text-align: center;
      line-height: 0.786667rem;
    }
    .icon_download {
      position: absolute;
      bottom: -0.4rem;
      left: 50%;
      transform: translateX(-50%);
      width: 4.48rem;
      height: 0.853333rem;
      background: #ff5543;
      box-shadow: 0 0.053333rem 0 #ffb4ac;
      border-radius: 0.586667rem;
      text-align: center;
      line-height: 0.853333rem;
      color: #fff;
      font-size: 0.346667rem;
    }
  }
}

.content_box {
  width: 8.933333rem;
  height: 2.666667rem;
  transform: translateY(1.2rem);
  display: flex;
  justify-content: space-between;
  .game_info {
    width: 6.4rem;
    height: 2.666667rem;
    .game_name {
      width: 6.4rem;
      font-size: 0.48rem;
      font-weight: bold;
      color: #222222;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
      margin-top: .266667rem;
    }
    .genre_str_box {
      font-size: 0.346667rem;
      color: #999999;
      margin-top: .133333rem;
      span {
        font-size: 0.346667rem;
        color: #999999;
      }
    }
    .game_type_box {
      width: 6.4rem;
      height: 1.04rem;
      overflow: hidden;
      font-size: .32rem;
      margin-top: .133333rem;
      .labels {
        display: inline-block;
        height: 0.453333rem;
        padding: 0 0.08rem;
        line-height: .453333rem;
        margin-right: 0.133333rem;
        margin-bottom: 0.133333rem;
      }
    }
  }
  img {
    display: inline-block;
    width: 2.466667rem;
    height: 2.466667rem;
    border-radius: 0.533333rem;
  }
}
</style>